<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org"
  xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width,user-scalable=no, initial-scale=1">
		<title>CRM</title>
		<link rel="stylesheet" type="text/css" href="/azxcrm/css/wap/mui.min.css" th:href="@{/azxcrm/css/wap/mui.min.css}"/>
		<link rel="stylesheet" type="text/css" href="/azxcrm/css/wap/mui.picker.min.css" th:href="@{/azxcrm/css/wap/mui.picker.min.css}"/>
		<link rel="stylesheet" type="text/css" href="../static/azxcrm/css/wap/aui.css" th:href="@{/azxcrm/css/wap/aui.css}"/>
		<link rel="stylesheet" type="text/css" href="../static/azxcrm/css/wap/order_detail.css" th:href="@{/azxcrm/css/wap/order_detail.css}"/>
		<link rel="stylesheet" type="text/css" href="//at.alicdn.com/t/font_835360_8flqp9ignrc.css"/>
		<script src="/azxcrm/js/wap/mui.min.js" th:src="@{/azxcrm/js/wap/mui.min.js}" type="text/javascript" charset="utf-8"></script>
		<script src="/azxcrm/js/wap/mui.picker.min.js" th:src="@{/azxcrm/js/wap/mui.picker.min.js}" type="text/javascript" charset="utf-8"></script>
		<script src="../static/js/jquery.min.js" th:src="@{/js/jquery.min.js}"></script>
		<script th:inline="javascript"> var ctx = [[@{/}]]; </script>
	</head>
	<body>
		<header class="aui-bar aui-bar-nav">
			 <a href="javascript:history.back(-1)"  class="aui-pull-left aui-btn">
	       		 <span class="iconfont icon-fanhui1">返回</span>
	    	</a>
		    <div class="aui-title">订单详情</div>
		</header>
		
		<section class="aui-grid aui-margin-b-15">
			<div class="aui-content aui-margin-b-15">
			    <ul class="aui-list aui-list-in">			       
			        <li class="aui-list-item">
			            <div class="aui-list-item-inner">
			            	<div class="clearfix">
			            		<div class="aui-list-item-title">订单编号：</div>	
			                	<div class="aui-text" th:text="${order.orderNum}"></div>
			            	</div>			                
			            </div>
			        </li>
			        <li class="aui-list-item">
			            <div class="aui-list-item-inner">
			            	<div class="clearfix">
				                <div class="aui-list-item-title">订单类型：</div>
				                <div class="aui-text" th:text="${order.typeName}"></div>
				            </div>    
			            </div>
			        </li>	
			        <li class="aui-list-item">
			            <div class="aui-list-item-inner">
			            	<div class="clearfix">
				                <div class="aui-list-item-title">订单状态：</div>
				                <div class="aui-text" th:if="${order.auditStatus} == 0">未审核</div>
				                <div class="aui-text" th:if="${order.auditStatus} == 1">审核中</div>
				                <div class="aui-text" th:if="${order.auditStatus} == 2">审核通过</div>
				                <div class="aui-text" th:if="${order.auditStatus} == 3">审核被拒</div>
				            </div>    
			            </div>
			        </li>
			    </ul>
			</div>
				
			<div class="aui-content aui-margin-b-15">
			    <ul class="aui-list aui-list-in">
			        <li class="aui-list-header">
			        	<h3><img src="../static/azxcrm/image/wap/customer.png" th:src="@{/azxcrm/image/wap/customer.png}">客户信息</h3>
			        </li>
			        <li class="aui-list-item">
			            <div class="aui-list-item-inner">
			            	<div class="clearfix">
			            		<div class="aui-list-item-title">客户姓名：</div>	
			                	<div class="aui-text" th:text="${order.customerClue.customerName}"></div>
			            	</div>			                
			            </div>
			        </li>
			        <li class="aui-list-item">
			            <div class="aui-list-item-inner">
			            	<div class="clearfix">
				                <div class="aui-list-item-title">手机号码：</div>
				                <div class="aui-text" th:text="${order.customerClue.customerCellphone}"></div>
				            </div>    
			            </div>
			        </li>	
			         <li class="aui-list-item">
			            <div class="aui-list-item-inner">
			            	<div class="clearfix">
				                <div class="aui-list-item-title">身份证号：</div>
				                <div class="aui-text" th:text="${order.customerClue.customerIdentityNum}"></div>
				            </div>    
			            </div>
			        </li>	

			    </ul>
			</div>
			
			<div class="aui-content aui-margin-b-15">
			    <ul class="aui-list aui-list-in">
			        <li class="aui-list-header">
			        	<h3><img src="../static/azxcrm/image/wap/saler_product.png" th:src="@{/azxcrm/image/wap/saler_product.png}">销售产品</h3>
			        </li>
			        <li class="aui-list-item">
			            <div class="aui-list-item-inner">
			            	<div class="clearfix">
			            		<div class="aui-list-item-title">销售产品：</div>	
			                	<div class="aui-text" th:text="${order.fullName}"></div>
			            	</div>			                
			            </div>
			        </li>
			        <li class="aui-list-item">
			            <div class="aui-list-item-inner">
			            	<div class="clearfix">
			            		<div class="aui-list-item-title">金额(￥)：</div>	
			                	<div class="aui-text" th:text="${order.productInfo.productPrice}"></div>
			            	</div>			                
			            </div>
			        </li>	
			        <li class="aui-list-item">
			            <div class="aui-list-item-inner">
			            	<div class="clearfix">
			            		<div class="aui-list-item-title">使用期限：</div>	
			                	<div class="aui-text"><span th:text="${order.productInfo.productTerm}"></span>个月</div>
			            	</div>			                
			            </div>
			        </li>	
			    </ul>
			    <div class="aui-bar aui-bar-tab" th:if="${order.auditStatus} == 1">
			        <a class="aui-bar-tab-item">                   
			            <div class="aui-bar-tab-label wait">审核中，请耐心等待...</div>
			        </a>           
		       </div>
		       	<div class="aui-bar aui-bar-tab btn2" th:if="${order.auditStatus} == 3">
		       		<input type="hidden" id="orderId" name="orderId" th:value="${order.orderId}">
			        <a class="aui-bar-tab-item" type="button" onclick="giveUpOrder()">                   
			            <div class="aui-bar-tab-label wait">放弃订单</div>
			        </a>           
		       </div>
			</div>

		</section>
	</body>
</html>
<script>
     sessionStorage.setItem("order",1);
     
		function giveUpOrder(){
			var btnArray = ['否', '是'];
			var orderId = document.getElementById('orderId').value;
			mui.confirm("是否要退单吗？", btnArray,function(e){
				 if (e.index == 1) {
			           $.ajax({
				    		cache : true,
				    		type : "POST",
				    		url : ctx + "/wap/order/giveUpOrder",
				    		data : {"orderId" : orderId},
				    		async : false,
				    		error : function(request) {
				    			mui.toast("系统错误", "error");
				    		},
				    		success : function(data) {
				    			if (data.code == 0) {
				    				mui.toast("退单成功,正在加载数据......"); 
				      		    	    setTimeout(function(){
				      		    	    	window.location.href= ctx + "/wap/order/followOrder"},2200)
				    			} else {
				    				mui.toast("退单失败");
				    			}
				    		}
				    	});
			        } 
				})
		}		
</script>
